package at.fhj.itm.model;

import javax.microedition.rms.RecordComparator;

public class VocabComparator implements RecordComparator
{
	public VocabComparator()
	{
		super();
	}
	
	public int compare(byte[] vocabEntry1, byte[] vocabEntry2) 
	{
		
		int comparison = 
		VocabEntry.getWord(vocabEntry1).toLowerCase()
		.compareTo(VocabEntry.getWord(vocabEntry2).toLowerCase());
		
		if(comparison>=1)
		{
			return RecordComparator.FOLLOWS;
		}
		else if(comparison<0)
		{
			return RecordComparator.PRECEDES;
		}
		
		return RecordComparator.EQUIVALENT;		
	}

}
